<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>SSE Example</title>
</head>
<body>
<h1>测试SSE服务推送</h1>
<div id="sse-data"></div>

<script>
    const sseData = document.getElementById("sse-data");

    const eventSource = new EventSource("http://localhost:9001/user/get");

    eventSource.onmessage = (event) => {
        sseData.innerHTML = event.data;
    };

    eventSource.onerror = (error) => {
        console.error("SSE Error:", error);
    };
</script>
</body>
</html>
